Skip to content

Updated code snippets#190

Merged
JeanLucPons merged 10 commits intomainfrom
docstring-arrays
Feb 12, 2026
Merged

Updated code snippets#190
JeanLucPons merged 10 commits intomainfrom
docstring-arrays

Conversation

@JeanLucPons
Copy link
Copy Markdown
Contributor

Update code snippet for Arrays.

@gubaidulinvadim , @TeresiaOlsson , @simoneliuzzo
It seems that I lost modifications I did previously regarding the big list of .rst files in api ?
Is this list automatically generated, in case it has nothing to do there or can we update it by hand ?

@JeanLucPons JeanLucPons marked this pull request as draft February 10, 2026 11:29
@TeresiaOlsson
Copy link
Copy Markdown
Contributor

I think the workflow is not so great at the moment. I changed so the rst files are automatically generated from scratch to get all parts in the docs without having to remember to manually modify when you have refactored something.

But then I also added the rst files into version control which I think means they are not generated from scratch unless you remember to first delete all of them, build the docs locally and commit any modified files... So maybe having them in version control is not a good solution.

I think the ideal solution would be to always automatically generate it from scratch and not have anything where manual tweaking is required because people will likely forget to do that and the docs become out of sync with the code. At least until we have reached a more stable version where parts are not significantly refactored anymore.

What do you think? If I understood it correctly the rst files before contained some manual parts to not include some classes?

@JeanLucPons
Copy link
Copy Markdown
Contributor Author

OK I see. No worries. I only concerns only few 'exclude-members':.
I will see what I can do but the idea is that some fileds/classes need to be excluded as the user does not need to see them.
It would be nice to avoid as much as possible any generated stuff to lie in the github repo.

@TeresiaOlsson
Copy link
Copy Markdown
Contributor

Do you think it might be possible to name those fields/classes with _ in the beginning and make use of that to automatically exclude them?

I also think generated things should be removed. I only did it because it seemed to be the recommendation when I looked at the different options. But I'm not convinced that it's a good recommendation.

@JeanLucPons
Copy link
Copy Markdown
Contributor Author

I'm working on it and I can say that autosummary is a pain.
I'm fighting with Jinja templates.
I also would like to exclude things without '_' such as model_config for instance or others fields that the user do not need.
At least give a way to do this.

@TeresiaOlsson
Copy link
Copy Markdown
Contributor

I also had a lot of issues... There is also autodoc2 which I saw some other packages use. But I'm not sure if that it easier to use. Maybe it always is a pain.

@JeanLucPons
Copy link
Copy Markdown
Contributor Author

I finally stopped trying to use Jinja templates and autosummary and I wrote a small python program that generates the rst files.
So it is easy to understand and to improve.
It generates tree of toctree and it provides good results.
Tomorrow i will check if internal links in the doc work also as expected.

@JeanLucPons
Copy link
Copy Markdown
Contributor Author

@TeresiaOlsson
The API reference is OK for me.
There are still duplicate warnings during the doc generation mainly link to wrong docstring in source.

@JeanLucPons JeanLucPons marked this pull request as ready for review February 12, 2026 07:31
@JeanLucPons
Copy link
Copy Markdown
Contributor Author

I ended the BPM array stuff.
Here is how it looks.
I can be used as a model to write code snippet, link, etc...

image

@JeanLucPons JeanLucPons merged commit 704e27b into main Feb 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants